<template>
	<view class="content poRel">
		<image :src="backage" style="width: 100vw;" mode="widthFix"></image>
		<view class="wid100 bacFFF" style="border-radius: 0rpx 0rpx 20rpx 20rpx;">
			<view class="wid90 mar dis disAl disJuC" style="height: 119rpx;">
				<view class="foSi30 fowe800">邀请步骤：</view>
				<view class="mar-left40 foSi25 fowe600" style="color: #737373;">分享海报 - 微信扫码 - 注册登录</view>
			</view>
		</view>
		<view class="poFix wid100 dis disAl disJuC bacFFF"
			style="height: 124rpx;border-top: 1rpx solid #878787;bottom: 0;">
			<view class="wid90 borRad40 dis disAl disJuC coFFF foSi35"
				style="height: 85rpx;background-color: #00C82D;">长按上图保存图片</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url: this.global.url,
				backage:"",
				distr:""
			}
		},
		onLoad() {
			this.poster()
		},
		methods: {
			poster(){
				var that = this;
				uni.request({
					url: that.global.url + 'api/qianyu_smfw/distr/poster',
					method: "POST",
					header: {
						'site-id': that.global.site_id, //自定义请求头信息
						'token': uni.getStorageSync('token')
					},
					data: {
						type: 2,
						qrCodePath:'/addon/qianyu_smfw/h5/#?distr_id='
					},
					success(res) {
						let result = res.data
						if (result.code == 1) {
							that.backage = result.data.backage
							that.distr = result.data.distr
						} else {
							uni.showToast({
								title: result.msg,
								//将值设置为 success 或者直接不用写icon这个参数
								icon: 'error',
								//显示持续时间为 2秒
								duration: 2000
							})
						}
					}
				})
			},
			banImg() {
				uni.getImageInfo({
					src: 'https://tse2-mm.cn.bing.net/th/id/OIP-C.mH9YLFEL5YdVxJM82mjVJQAAAA?rs=1&pid=ImgDetMain',
					success: (res) => {
						uni.saveImageToPhotosAlbum({
							filePath: res.path,
							success: () => {
								uni.showToast({
									title: '保存成功',
									icon: 'none',
									duration: 1000
								});
							},
							fail: () => {
								uni.showToast({
									title: '保存失败',
									icon: 'none',
									duration: 1000
								});
							}
						})
					}
				})
			}
		},
	}
</script>

<style>
	.content {
		min-height: 100vh;
		background-color: #F2F2F2;
	}
</style>